<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>D3 选择集概念练习</title>
    <script src="https://cdn.bootcss.com/d3/5.15.1/d3.js"></script>
    <style>
        div {
            height: 100px;
            width: 100px;
            background-color: #ccc;
            margin: 10px;
        }

    </style>
</head>

<body>
    <div></div>
    <div id="box" title="这是title">
        <p></p>
        <p></p>
        <p></p>
    </div>
    <div></div>
    <script>
        let divs = document.getElementsByTagName("div");
        // console.log(divs)

        divs = document.getElementById("box");
        // console.log(divs)

        divs = d3.select("#box");
        console.log(divs)

        objs = d3.select("body")

        paragraphs = objs.selectAll("div")
            .attr("title", "xcxc")
            .selectAll("p")
            .text("这是段落")

        console.log(paragraphs)

        // console.log(divs)
    </script>
</body>

</html>
